Skip to content

Add page vote buttons with Segment and Hotjar survey integration#10488

Merged
rosieyohannan merged 10 commits into
mainfrom
DOC-43-event-driven-survey
Jul 15, 2026
Merged

Add page vote buttons with Segment and Hotjar survey integration#10488
rosieyohannan merged 10 commits into
mainfrom
DOC-43-event-driven-survey

Conversation

@rosieyohannan

@rosieyohannan rosieyohannan commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the old commented-out Yes/No buttons in the article footer with working thumbs up/down Was this page helpful? buttons
  • Each button fires two events on click:
    • analytics.track('docs_page_vote', { vote: 'yes'|'no', page: <pathname> }) — Segment event for Amplitude reporting
    • hj('event', 'docs_page_feedback') — triggers a Hotjar survey popover (survey configured in Hotjar dashboard with a JavaScript API event trigger named docs_page_feedback)
  • New JS lives in ui/src/js/16-hotjar-feedback.js, auto-bundled into site.js
  • SVG icons are inlined with currentColor for dark mode support

> Note: THIS CHANGE IS WAITING ON MOVING KAPA TO THE TOP BY SEARCH

Hotjar setup required

The Hotjar survey must be set to Active in the dashboard, with:

  • Targeting → trigger type: Event, name: docs_page_feedback
  • Behavior → Timing: set to a very long delay so it only opens via the button, never auto-fires

Test plan

  • Build locally and verify Yes/No buttons render correctly in light and dark mode
  • In browser console, stub window.hj = (e, n) => console.log(e, n) and window.analytics = { track: (e, p) => console.log(e, p) }, click each button and confirm both events fire with the correct vote value
    DONE:
Screenshot 2026-07-14 at 14 06 07
  • On the live site with Hotjar active, confirm clicking either button opens the survey popover

🤖 Generated with Claude Code

Replaces the old commented-out Yes/No buttons with a single "Leave feedback"
button that fires a Hotjar JS API event (docs_page_feedback) to open a survey
popover on click.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jun 17, 2026

Copy link
Copy Markdown

DOC-43

rosieyohannan and others added 6 commits July 1, 2026 15:18
Replaces single feedback button with thumbs up/down Yes/No buttons.
Both buttons fire a Segment docs_page_vote event (vote: yes/no, page path)
and a Hotjar docs_page_feedback event to trigger the survey popover.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Last path segment had a copied value from the thumbs-down SVG causing
the handle to render incorrectly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rosieyohannan rosieyohannan changed the title WIP add Hotjar feedback button to article footer Add page vote buttons with Segment and Hotjar survey integration Jul 14, 2026
Matches Figma dark mode spec (#a5aab9) for Yes/No button text and icons.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rosieyohannan rosieyohannan marked this pull request as ready for review July 14, 2026 13:07
@rosieyohannan rosieyohannan requested review from a team as code owners July 14, 2026 13:07
rosieyohannan and others added 2 commits July 15, 2026 14:00
…urvey

# Conflicts:
#	ui/src/partials/article-footer.hbs
…s/No buttons

Buttons now show a clear selected state on click and can be toggled
back and forth freely, since there was no existing pattern on the
site to model this interaction after.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@rosieyohannan rosieyohannan merged commit 0a6e902 into main Jul 15, 2026
4 checks passed
@rosieyohannan rosieyohannan deleted the DOC-43-event-driven-survey branch July 15, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants